<template>
  <div>
    <el-table
      border
      stripe
      :data="results"
      :height="height"
      @row-dblclick="detail"
    >
      <el-table-column
        label="编号"
        width="80"
        align="center"
      >
        <template v-slot="scope">
          {{ scope.$index + 1 }}
        </template>
      </el-table-column>
      <el-table-column
        label="日期"
        prop="created_at"
        align="center"
      />
      <el-table-column
        label="所在地块"
        prop="field.name"
        align="center"
      />
      <el-table-column
        label="作物"
        prop="crop.name"
        align="center"
      />
      <el-table-column
        label="生长期"
        prop="crop.growth"
        align="center"
      />
      <el-table-column
        label="ET0"
        prop="et0"
        align="center"
      />
      <el-table-column
        label="kc"
        prop="crop.kc"
        align="center"
      />
      <el-table-column
        label="ETc"
        prop="etc"
        align="center"
      />
    </el-table>
  </div>

</template>

<script>
export default {
  props: {
    results: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    return {
      height: 'calc(100vh - 224px)'
    }
  },
  methods: {
    detail(row) {
      console.log(row)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>

